#!/usr/bin/env python
import cProfile as profile
import pstats
from hashsummary import HashSummary
import pickle
from pympler.classtracker import ClassTracker
from pympler.classtracker_stats import Stats
from pympler.asizeof import asizeof

filename = 'input_zipf_1000000_1.5'
data_dir = "../../data/"
_input = pickle.load( open(data_dir +  filename) )
print asizeof(_input)

tracker = ClassTracker()
tracker.track_class(HashSummary,resolution_level=2)
k = 1000
hs = HashSummary(k)
tracker.create_snapshot()
for _item in _input :
	hs.insert(_item)
tracker.create_snapshot()
tracker.stats.sort_stats('size').reverse_order().print_stats()


